package com.adv.vo;

import java.util.Arrays;
import java.util.List;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

public class RoleForm {

	private Integer id;

	@Length(max = 100, message = "最多可以输入100个字符")
	@NotBlank(message = "账户不能为空")
	private String rolename;

	@Length(max = 100, message = "最多可以输入100个字符")
	@NotBlank(message = "角色描述不能为空")
	private String roledesc;

	@NotNull(message = "状态不能为空")
	private Boolean enable;

	private String addtime;

	private boolean checked;

	private List<PermissionForm> permissions;
	private Integer[] checkedPermissions;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getRolename() {
		return rolename;
	}

	public void setRolename(String rolename) {
		this.rolename = rolename;
	}

	public String getRoledesc() {
		return roledesc;
	}

	public void setRoledesc(String roledesc) {
		this.roledesc = roledesc;
	}

	public Boolean getEnable() {
		return enable;
	}

	public void setEnable(Boolean enable) {
		this.enable = enable;
	}

	public String getAddtime() {
		return addtime;
	}

	public void setAddtime(String addtime) {
		this.addtime = addtime;
	}

	public boolean isChecked() {
		return checked;
	}

	public void setChecked(boolean checked) {
		this.checked = checked;
	}

	public List<PermissionForm> getPermissions() {
		return permissions;
	}

	public void setPermissions(List<PermissionForm> permissions) {
		this.permissions = permissions;
	}

	public Integer[] getCheckedPermissions() {
		return checkedPermissions;
	}

	public void setCheckedPermissions(Integer[] checkedPermissions) {
		this.checkedPermissions = checkedPermissions;
	}

	@Override
	public String toString() {
		return "RoleForm [id=" + id + ", rolename=" + rolename + ", roledesc=" + roledesc + ", enable=" + enable
				+ ", addtime=" + addtime + ", checked=" + checked + ", permissions=" + permissions
				+ ", checkedPermissions=" + Arrays.toString(checkedPermissions) + "]";
	}

}
